package com.example.banksystem.service;

import com.example.banksystem.entity.Account;
import com.example.banksystem.exception.InsufficientBalanceException;
import com.example.banksystem.exception.AccountNotFoundException;
import com.example.banksystem.exception.PasswordMismatchException;

public interface AccountService {
    // 根据卡号查询账户
    Account getAccountByCardNumber(String cardNumber) throws AccountNotFoundException;

    // 验证交易密码
    void verifyTransactionPassword(Account account, String inputPwd) throws PasswordMismatchException;

    // 扣减账户余额（加锁确保并发安全）
    void deductBalance(Account account, BigDecimal amount) throws InsufficientBalanceException;

    // 增加账户余额
    void increaseBalance(Account account, BigDecimal amount);
}
